package com.xiaoai.io.bio2two;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.Socket;
import java.util.Scanner;

/**
 * 客户端 多收多发
 *
 * @Author
 * @Date 2021-09-06 00:25
 */
public class Client {

    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1",9999);
        OutputStream os = socket.getOutputStream();
        Scanner sc = new Scanner(System.in);

        while (true){
            System.out.print("客户端2：");
            String msg = sc.nextLine();
            PrintStream ps = new PrintStream(os);
            ps.println(msg);
            ps.flush();
        }

    }


}
